package com.taxshare.purchaser.controller;

import com.taxshare.mybatis.pager.PageRequest;
import com.taxshare.purchaser.entity.MachinTicketEntity;
import com.taxshare.purchaser.service.MachinTicketCollectService;
import com.taxshare.purchaser.view.dto.MachinTicketDTO;
import com.taxshare.response.beans.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author YANG
 * @date 2021/4/9
 */
@RestController
@RequestMapping("/machinTicketCollect")
@Api(tags = "机打发票采集")
public class MachinTicketCollectController {

    @Autowired
    MachinTicketCollectService machinTicketCollectService;

    @PostMapping("/query")
    @ApiOperation(value = "机打发票查询", notes = "发票采集")
    public Response<MachinTicketEntity> queryMachinTicket(@RequestBody PageRequest<MachinTicketDTO> query) {
        return machinTicketCollectService.queryMachinTicket(query);
    }

    @PostMapping("/delete")
    @ApiOperation(value = "机打发票删除", notes = "发票采集")
    public Response machinTicketDelete(@RequestBody MachinTicketDTO machinTicketDTO) {
        return machinTicketCollectService.machinTicketDelete(machinTicketDTO);
    }

    @PostMapping("/personLiable")
    @ApiOperation(value = "责任人、记账科目、授权报销设置设置", notes = "未报销")
    public Response personLiable(@RequestBody MachinTicketDTO machinTicketDTO) {
        return machinTicketCollectService.personLiable(machinTicketDTO);
    }

    @PostMapping("/submit")
    @ApiOperation(value = "提交报销", notes = "未报销")
    public Response submitReimbursement(@RequestBody MachinTicketDTO machinTicketDTO) {
        return machinTicketCollectService.submitReimbursement(machinTicketDTO);
    }

    @PostMapping("/applicationRejected")
    @ApiOperation(value = "申请驳回", notes = "已报销")
    public Response applicationRejected(@RequestBody MachinTicketDTO machinTicketDTO) {
        return machinTicketCollectService.applicationRejected(machinTicketDTO);
    }
}
